BlueSpray - Help
© SchoonerTurtles, Inc. 2012-2015

Introduction
Contents
Getting Started
Download
Navigating
Tutorials
Scripting
Advanced
About

Introduction to JavaScript In Java

It is very popular to program with JavaScript in Internet browsers. JavaScript allows you to access all the objects in a Java program including the standard Java language objects. This means you can use Java documentation such as that found at Sun's Java web sites. In fact, you'll find Java documenation much more valuable because most of the JavaScript documentation is about web programming. We'll give you a start here and then you can access Sun's documenation, any of the thousands of web pages on Java, or purchase one of the many books on Java. This also means you'll be learning to program in Java and if you then want to learn to extend BlueSpray with Java you'll be on your way!

Getting Started

Let's start with some mathematics but we'll access Java's rather extensive math library.

	var x=Math.min(0,10);
	println("x="+x);

"Math" is the class in Java that contains most of the basic mathematical functions you'll need and "min()" returns the minimum of two values. You should see "x=0" appear in the variable panel. Now try the following:

	var x=Math.abs(-10);
	var y=Math.sin(Math.toRadians(45));
	var x=Math.pow(2,10);
	println("x="+x+"y="+y+"z="+z);

You are now able to use the Java Math class and can find detailed information on all it's functions here. Accessing the standard Java classes are just that easy and accessing BlueSpray's classes are just as easy.

Tutorials

Below are a series of turtorials on programming in JavaScriopt. We recommend going through each tutorial and then returning to the scripting in BlueSpray tutorials. Also, remember that programming should be fun!

Drawing

One of the powerful and fun aspects of programming in JavaScript is how easy it is to create your own graphics. When you return to the BlueSpray tutorials you'll see how to combine Java and BlueSpray classes to give you full control of processing and cartography of your GIS projects.

- Add demo of drawing to a gracphis context and saving to a gif file

- Animate it?

Lists?

-

 

Collections?

-

 

Database Access?

- Using JDBC and ODBC?

 

Reading and WRiting text files?

- It's actually easier in BlueSpray

 

Network IO?

- Downloading data form the internet?